package com.cian.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cian.entity.History;
import com.cian.entity.dto.AccountHistoryDTO;
import com.cian.entity.dto.GoodsHistoryDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.sql.Date;
import java.util.List;

/**
 * <p>
 * 销售记录的历史表项 Mapper 接口
 * </p>
 *
 * @author Cian
 * @since 2021-03-15
 */
@Mapper
@Component
public interface HistoryMapper extends BaseMapper<History> {
    public void setSalfValue(@RequestParam("value")int value);
    public void insertChangeStock(@Param("account") String account,@Param("serverCode") String serverCode
            ,@Param("date") Date date, @Param("coId") int coId, @Param("stock") int stock);
    public void updateChangeStock(@Param("account") String account,@Param("serverCode") String serverCode
            ,@Param("date") Date date, @Param("coId") int coId, @Param("stock") int stock);
    public void insertInputStock(@Param("account") String account,@Param("serverCode") String serverCode
            ,@Param("date") Date date, @Param("coId") int coId, @Param("input") int input);
    public void updateInputStock(@Param("account") String account,@Param("serverCode") String serverCode
            ,@Param("date") Date date, @Param("coId") int coId, @Param("input") int input);
    public AccountHistoryDTO obtainAccountHistory(@Param("account") String account,@Param("date") Date date);
    public AccountHistoryDTO obtainHistoryForLine(@Param("account") String account,@Param("serverCode") String serverCode,
                                        @Param("date") Date date);
    public List<GoodsHistoryDTO> obtainGoodsHistory(@Param("account") String account,
                                   @Param("serverCode") String serverCode, @Param("leftDate") Date leftDate,
                                   @Param("rightDate") Date rightDate);
    public List<GoodsHistoryDTO> obtainPriceHistory(@Param("account") String account,
                                              @Param("serverCode") String serverCode, @Param("leftDate") Date leftDate,
                                              @Param("rightDate") Date rightDate);
}
